<admintpl file="header" />
<style type="text/css">
.pic-list li {
	margin-bottom: 5px;
}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('AdminCard/add',array('id'=>empty($item['id'])?'':$item['id']))}" target="_self">发卡</a></li>
		</ul>
		<form action="{:U('AdminCard/send_post')}" method="post" class="form-horizontal js-ajax-forms" onsubmit="return check_form()" enctype="multipart/form-data">
			<div class="row-fluid">
				<div class="span9">
					<table class="table table-bordered">
						<tr>
							<th>物流公司名称<span class="form-required">*</span></th>
							<td>
								<select name="lid" id="lid">
									<option value="">请选择</option>
									<foreach name="logistics_list" item="litem">
										<option value="{$litem['id']}">{$litem.logistics_name}</option>
									</foreach>
								</select>
							</td>
						</tr>
						<tr>
							<th>初始卡号<span class="form-required">*</span></th>
							<td><input type="text" name="card_number" id="card_number" value="" style="width: 400px" placeholder="请输入初始卡号"> </td>
						</tr>
						<tr>
							<th>发卡数量<span class="form-required">*</span></th>
							<td><input type="text" name="number" id="number" value="" style="width: 400px" placeholder="请输入发卡数量"> </td>
						</tr>
                    </table>
				</div>

			</div>
			<div class="form-actions">
                <input type="hidden" name="id" value="{$item.id}"/>
				<button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
				<a class="btn" href="{:U('AdminCard/index')}">返回</a>
			</div>
		</form>
	</div>

	<script>
		function check_form(){
			var lid = $("#lid").val();
			if(lid == ''){
				alert("请选择物流公司");return false;
			}
			var card_number = $("#card_number").val();
			if(card_number == ''){
				alert("请输入初始卡号");return false;
			}
			if(isNaN(card_number)){
				alert("初始卡号输入有误");return false;
			}
			var number = $("#number").val();
			if(number == ''){
				alert("请输入发卡数量");return false;
			}
			if(isNaN(number) || number<1){
				alert("发卡数量输入有误");return false;
			}
			return true;
		}
	</script>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>

	</body>
</html>